package com.cloudbroker.openapi.manage.controller;

import static com.cloudbroker.bcs.platform.dav.common.util.RequestUtil.getSingleParameterMapForBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import com.cloudbroker.bcs.platform.dav.bizapi.service.business.adpage.result.TenantListData;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cloudbroker.bcs.common.entity.HSBCPSBackVO;
import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.platform.dav.bizapi.service.base.vo.HSBCPSVO;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.adpage.result.AdpageListResult;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.adpage.result.BrokerListData;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.adpage.vo.AdpageListForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.adpage.vo.AdpageUpdateParam;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.business.AdpageT2BizService;
import com.cloudbroker.bcs.platform.dav.common.ext.annotation.SaveLog;

@Controller
public class AdpageController {
    
    @Resource
    private AdpageT2BizService adpageT2;
    
    /**
     * 大V列表
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping("/func_broker_list")
    @SaveLog(remark = "大V列表")
    public BrokerListData funcBrokerList(HttpServletRequest request , String jsonpcallback){
    	HSBCPSVO form = getSingleParameterMapForBody(request , HSBCPSVO.class);
        return VOUtil.setJsonpResult(adpageT2.funcBrokerList(form), jsonpcallback);
    }
    
    /**
     * 广告页列表
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping("/func_adpage_list")
    @SaveLog(remark = "广告页列表")
    public AdpageListResult funcAdpageList(HttpServletRequest request , String jsonpcallback){
    	AdpageListForm form = getSingleParameterMapForBody(request , AdpageListForm.class);
        return VOUtil.setJsonpResult(adpageT2.funcAdpageList(form), jsonpcallback);
    }
    
    /**
     * 广告页修改
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping("/func_adpage_update")
    @SaveLog(remark = "广告页修改")
    public HSBCPSBackVO funcAdpageUpdate(HttpServletRequest request , String jsonpcallback){
        AdpageUpdateParam form = getSingleParameterMapForBody(request , AdpageUpdateParam.class);
        return VOUtil.setJsonpResult(adpageT2.funcAdpageUpdate(form), jsonpcallback);
    }
    /**
     * 租户列表
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping("/func_tenant_list")
    @SaveLog(remark = "租户列表")
    public TenantListData funcTenantList(HttpServletRequest request , String jsonpcallback){
        HSBCPSVO form = getSingleParameterMapForBody(request , HSBCPSVO.class);
        return VOUtil.setJsonpResult(adpageT2.funcTenantList(form), jsonpcallback);
    }
}
